package lesson2;

import java.util.Arrays;

/**
 * @author pengjz <br>
 * @version 1.0 <br>
 * @description Task1 <br>
 * @date 2021/10/10 o <br>
 */
public class Task1 {
    public static int[] solution(int[] A, int K) {
        // write your code in Java SE 8

        for (int i = 0; i < K; i++) {
            int temp = A[A.length - 1];
            System.arraycopy(A, 0, A, 1, A.length - 1);
            A[0] = temp;
        }
        return A;
    }

    public static void main(String[] args) {
        System.out.println(Arrays.toString(solution(new int[]{3, 8, 9, 7, 6},
                3)));
    }
}
